package com.wxyzz.common.core.exception;


import com.wxyzz.common.core.common.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * --- 加油，努力 ---
 *
 * @Author XYP
 * @Date 2024/10/6
 * @Solgne 从想做到能做
 * @Desc
 */
@RestControllerAdvice
public class MyGlobalExceptionHandler {

    @ExceptionHandler(CustmerException.class)
    public R handlerException (CustmerException e) {
        System.out.println("全局异常处理器捕获到了异常...");
        return R.fail(e.getCode(),e.getMsg());
    }

}
